The present invention relates to a method for simulation and to a device for carrying out the method.
Simulations of computer modules serve the optimizing of the system architecture of a computer, the development of suitable software, and the early detection of errors before the hardware is actually realized. In this way significant savings can be gained in the development process.
The pattern of a system should be understood as the arrangement of a microcontroller with peripheral modules and an external environment. The microcontroller specifically is the pure central processing unit (CPU). But microcontroller chips generally also have peripheral modules on the chip as well. Peripheral modules can have a wide variety of tasks; for instance, analog to digital converters (ADC), counters, serial interfaces, and so on. In this regard, peripheral modules are always hardware modules.
If, for example, a peripheral module is being developed for a microcontroller, this module is simulated with typical signal patterns, and is configured and controlled by the preferably also simulated microprocessor. The simulated states of the module are interrogated and evaluated by the microprocessor. Since the simulations have a precise clock cycle, all modules are always cosimulated when the microcontroller evaluates the states of the peripheral module. This evaluation can prolong the simulation time considerably.
However, particularly in the case when several modules are simulated at the same time, the total run can require a relatively long period of time, especially since the simulation of all modules always continues, even when the states of one module are being evaluated, owing to the unified processor clock.
Hitherto, the prolonged simulation time was accepted into the bargain, or the evaluation of the peripheral states was reduced to a minimum or was not done during the system simulation.
European Patent Application No. 0 777 180 already teaches a method for simulating and emulating systems, consisting of software and (simulated) hardware components. The method provides the possibility of interaction between the hardware and software components while at the same time the two systems are largely decoupled.
The basic idea of this method is to let the clocks of the components run independently and to synchronize them only at those points at which an interaction between the systems occurs, and only for the strictly necessary number of cycles. (Note: the term “clock of a component” is used in the sense of the clock that measures the simulated time). The real time is of course equal for all component simulations. To clarify the difference: One second of simulated time can last an hour in real time, for example.
The advantage of this method is that a rapidly simulatable system component is not slowed down by a slow one. This is of course also true when the interaction between the components is small. On the other hand, when the two clocks are rigidly synchronized, then the speed of simulation can never be higher than that of the slowest comonents.
The disadvantage of the method is that it cannot be tolerated in many system simulations that the clocks of the components do not have absolute synchronization. In addition to this, simulation runs cannot be fully reproduced, since the relative position of the clocks of the subcomponents are influenced, for instance by the loading of the simulation computer.